﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisitorPattern.Samples;

internal class MarkdownVisitor : IVisitorSample
{
    public void VisitImage(ImageElement imageElement)
    {
        Console.WriteLine($"![Image]({imageElement.Url})");
    }

    public void VisitPDF(PDFElement pdfElement)
    {
        Console.WriteLine($"PDF 文档 **{pdfElement.PDFName}**");
    }

    public void VisitTable(TableElement tableElement)
    {
        Console.WriteLine($"| Table:{tableElement.Rows}x{tableElement.Columns} |");
    }

    public void VisitText(TextElement textElement)
    {
        Console.WriteLine(textElement.Content);
    }
}
